@dataknut)CC-BY-SA unless otherwise noted.
To extract and visualise tweets and re-tweets of #birdoftheyear OR #boty in September/October 2018.
Borrowing extensively from https://github.com/mkearney/rtweet
The analysis used rtweet to ask the Twitter search API to extract ‘all’ tweets containing the #birdoftheyear OR #boty hashtags in the ‘recent’ twitterVerse.
It is therefore possible that not quite all tweets have been extracted although it seems likely that we have captured most recent human tweeting which was the main intention. Future work should instead use the Twitter streaming API.
The data has:
Figure 3.1: Number of tweets and tweeters
Figure 3.1 shows the number of tweets and tweeters in the data extract by day. The quotes, tweets and re-tweets have been separated. Looks to me like there’s quite a lot of activity at weekends…
If you are in New Zealand and you are wondering why there are no tweets today (2018-10-01) the answer is that twitter data (and these plots) are working in UTC and (y)our today hasn’t started yet in UTC - but don’t worry, all the tweets are here. It’s just our old friend the timezone… :-)
Next we’ll try by screen name.
Figure 3.2: N tweets per day by screen name
Figure 3.2 is a really bad visualisation of all tweeters tweeting over time. Each row of pixels is a tweeter (the names are probably illegible) and a green dot indicates a few tweets in the given day while a red dot indicates a lot of tweets. We’ve used plotly::ggplotly() so you can hover over the data points but it’s still pretty messy.
So let’s re-do that for the top 50 tweeters so we can see their tweetStreaks (tm)…
Top tweeters:
| screen_name | nTweets |
|---|---|
| birdoftheyear | 150 |
| coolbiRdpics | 47 |
| testeeves | 44 |
| Forest_and_Bird | 43 |
| jackcraw57 | 36 |
| vote4kaki | 35 |
| mifflangstone | 35 |
| NatForsdick | 35 |
| thebushline | 28 |
| newzealandbirds | 24 |
| kiwilullaby | 21 |
| Em_Rawson | 20 |
| gruesomegull | 20 |
| votebittern | 19 |
| This_NZ_Life | 18 |
And their tweetStreaks are shown in 3.3…
Figure 3.3: N tweets per day minutes by screen name (top 50, reverse alphabetical)
Any twitterBots…?
This is very quick and dirty but… Figure 3.4 plots the number of tweets for each concatenated hashtag string (non-separated hashtags) after removing tweets which have variants of #birdOfTheYear and #boty as the only hashtags and selecting the top 50. Tweets mentioning birds without using a #<birdName> hashtag will not show up; birds #mentioned in tweets with a lot of varying other #hashtags will be under-represented etc etc. This is a really imperfect measure of just about anything so #YMMV.
Figure 3.4: Top 50 hashtag strings
Table 3.2 shows a slightly more intelligible table of the same data summarised across all days to date. Note that this is not a true count of the mentions of a particular #hashtag - we would need to seperate the hashtags and then count unique hashtags for that. Work in progress…
| hashtags | nTweets |
|---|---|
| takayay | 503 |
| gannet | 25 |
| Vote4Kakī|kakī | 24 |
| StanyAgaty|KłamaćJakMorawiecki|PiS|DośćKłamstw|Podpaski | 13 |
| birds|birdwatching | 8 |
| Pukeko|Kiwi|Australia | 7 |
| takahey|votetakahē | 7 |
| voterowi | 7 |
| MenInBlack|BIB | 6 |
| TeamKakī|kakī|genetic|genomic | 6 |
| kereru|kakī | 6 |
| littlepenguin | 6 |
| DammitGannet | 5 |
| TeamKaki | 5 |
| TeamKakī | 4 |
| doadivebombbro|dammitgannet | 4 |
| kotāre|kingfisher | 4 |
| seabirds|albatross | 4 |
| BrotherOfTheYear|TokyoInternationalFilmFestival2018|BrotherOfTheYearPH | 3 |
| StanyAgaty|KłamaćJakMorawiecki|PiS|DośćKłamstw | 3 |
| TeamBlackPetrel | 3 |
| VoteRuru | 3 |
| dammitgannet|doadivebombbro | 3 |
| evidence|conservation|kakī | 3 |
| votetomtit|itsthetits | 3 |
| DopestBirds | 2 |
| kakī | 2 |
| votetakahē|makebirdsroundagain | 2 |
| BIB | 1 |
| BrotherOfTheYear|BrotherOfTheYearPH | 1 |
| DidYouKnow|Travel|adventure | 1 |
| Kaczyński | 1 |
| Kakī | 1 |
| KotaPrezesa | 1 |
| KŌTARE | 1 |
| Penguin | 1 |
| TeamKakī|dopest | 1 |
| TeamTawaki | 1 |
| Vote4Kakī | 1 |
| animatethelivings|canlılarıcanlamdıralım|muslumtekin_ogr|petsofinstagram|pets|petstagram|petslovers|bird | 1 |
| fallcolours|woodpecker|SundayFunday | 1 |
| kakī|BraidedRiver | 1 |
| makebirdsroundagain|manyshapesareround|livelaughtakahē|takayay|votetakahē | 1 |
| teamrockhopper | 1 |
Analysis completed in 7.833 seconds ( 0.13 minutes) using knitr in RStudio with R version 3.5.1 (2018-07-02) running on x86_64-apple-darwin15.6.0.
A special mention must go to https://github.com/mkearney/rtweet (Kearney 2018) for the twitter API interaction functions.
Other R packages used:
Dowle, M, A Srinivasan, T Short, S Lianoglou with contributions from R Saporta, and E Antonyan. 2015. Data.table: Extension of Data.frame. https://CRAN.R-project.org/package=data.table.
Kearney, Michael W. 2018. Rtweet: Collecting Twitter Data. https://cran.r-project.org/package=rtweet.
R Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Sievert, Carson, Chris Parmer, Toby Hocking, Scott Chamberlain, Karthik Ram, Marianne Corvellec, and Pedro Despouy. 2016. Plotly: Create Interactive Web Graphics via ’Plotly.js’. https://CRAN.R-project.org/package=plotly.
Wickham, Hadley. 2009. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. http://ggplot2.org.
Wickham, Hadley, Jim Hester, and Romain Francois. 2016. Readr: Read Tabular Data. https://CRAN.R-project.org/package=readr.
Xie, Yihui. 2016a. Bookdown: Authoring Books and Technical Documents with R Markdown. Boca Raton, Florida: Chapman; Hall/CRC. https://github.com/rstudio/bookdown.
———. 2016b. Knitr: A General-Purpose Package for Dynamic Report Generation in R. https://CRAN.R-project.org/package=knitr.